Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ContentTypeId conflict #3967

Merged
merged 5 commits into from
May 5, 2019
Merged

Conversation

CrazyHZM
Copy link
Member

@CrazyHZM CrazyHZM commented May 1, 2019

What is the purpose of the change

Fix Serialization ContentTypeId conflict between avro protocol and protocoluff protocol #3926

Brief changelog

XXXXX

Verifying this change

XXXXX

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Make sure there is a GITHUB_issue field for the change (usually before you start working on it). Trivial changes like typos do not require a GITHUB issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
  • Format the pull request title like [Dubbo-XXX] Fix UnknownException when host config not exist #XXX. Each commit in the pull request should have a meaningful subject line and body.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit-test to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add integration-test in test module.
  • Run mvn clean install -DskipTests=false & mvn clean test-compile failsafe:integration-test to make sure unit-test and integration-test pass.
  • If this contribution is large, please follow the Software Donation Guide.

@codecov-io
Copy link

codecov-io commented May 1, 2019

Codecov Report

Merging #3967 into master will increase coverage by <.01%.
The diff coverage is 66.66%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #3967      +/-   ##
============================================
+ Coverage     63.58%   63.58%   +<.01%     
  Complexity      100      100              
============================================
  Files           720      720              
  Lines         31838    31839       +1     
  Branches       5113     5114       +1     
============================================
+ Hits          20245    20246       +1     
  Misses         9273     9273              
  Partials       2320     2320
Impacted Files Coverage Δ Complexity Δ
...c/main/java/org/apache/dubbo/common/Constants.java 93.33% <ø> (ø) 0 <0> (ø) ⬇️
.../serialize/protostuff/ProtostuffSerialization.java 60% <0%> (ø) 0 <0> (ø) ⬇️
.../apache/dubbo/remoting/transport/CodecSupport.java 77.77% <0%> (-3%) 0 <0> (ø)
...dubbo/common/serialize/kryo/KryoSerialization.java 60% <0%> (ø) 0 <0> (ø) ⬇️
...dubbo/common/serialize/java/JavaSerialization.java 80% <100%> (ø) 0 <0> (ø) ⬇️
...mmon/serialize/hessian2/Hessian2Serialization.java 80% <100%> (ø) 0 <0> (ø) ⬇️
...dubbo/common/serialize/avro/AvroSerialization.java 100% <100%> (ø) 0 <0> (ø) ⬇️
...mon/serialize/java/CompactedJavaSerialization.java 80% <100%> (ø) 0 <0> (ø) ⬇️
.../serialize/nativejava/NativeJavaSerialization.java 80% <100%> (ø) 0 <0> (ø) ⬇️
...mmon/serialize/fastjson/FastJsonSerialization.java 100% <100%> (ø) 0 <0> (ø) ⬇️
... and 10 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 74a491b...e0d5c00. Read the comment docs.

/**
* Serizlization ContentTypeId
*/
public static final byte AVRO_SERIALIZATION_ID = 1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is wrong, avro is 10...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

public static final byte AVRO_SERIALIZATION_ID = 11 should be better

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

public static final byte AVRO_SERIALIZATION_ID = 11 should be better

What are the uses of 1 and 5 here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's simply leave it as is. I believe the original intention is: 1, 2, 4, 8, 16...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have modified it.

Copy link
Member

@beiwei30 beiwei30 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls. check my comments.

Copy link
Member

@beiwei30 beiwei30 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@beiwei30 beiwei30 merged commit 89f6d6d into apache:master May 5, 2019
public static final byte PROTOSTUFF_SERIALIZATION_ID = 10;
public static final byte AVRO_SERIALIZATION_ID = 11;
public static final byte GSON_SERIALIZATION_ID = 16;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you can define a sub-constant class. What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for a specific constants class

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this suggestion is good, I will modify it later.

@CrazyHZM CrazyHZM mentioned this pull request May 6, 2019
6 tasks
@CrazyHZM CrazyHZM deleted the avroSerializationId branch May 14, 2019 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants